﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainPage.aspx.cs" Inherits="MainPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>系统首页</title>
    <link href="css/Default.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    body{margin:0px;padding:0px;scroll:no;}
    #menu{border:solid 1px gray;width:19%;float:left;overflow:auto;}
    #btn{width:1%;float:left;position:relative;padding:0px 2px;}
    #data{width: 79%; float: right; border: solid 1px gray;}
    #arrow{color:blue;position:absolute;top:45%;cursor:pointer;}
    #head{
	height:110px;
	border:solid 1px gray;
	margin-bottom:3px;
	color:cornflowerblue;
	font-family:黑体;
	font-size:40px;
	background-image: url(images/mainbg.jpg);
    }
    #baseinfo
    {
	position:relative;
	padding:5px;
	background-image: url(images/menubg1.jpg);
    }
    #lblUser{color:crimson;margin:0px 5px;}
    #lblDept{color:blue;margin:0px 5px;}
    #baseinfo a{cursor:pointer;margin:0px 5px;}
    #hint{margin-left:20px;padding:5px;}
    </style>
    <script type="text/javascript" src="js/Common.js"></script>
    <script type="text/javascript" src="js/OpenWin.js"></script>
</head>
<body scroll="no">
    
    <form id="form1" runat="server">
        <div id="head">LOGO</div>
        <div id="baseinfo">
            当前登录用户：<asp:Label ID="lblUser" runat="server" Text=""></asp:Label>
            所属部门：<asp:Label ID="lblDept" runat="server" Text=""></asp:Label>
            <a onclick="toEditPwd()">密码修改</a>　
            <a onclick="relogin()">重新登录</a>　
            <a onclick="exit()">退出系统</a>
            <a id="hint" runat="server"></a>
        </div>
        <div id="menu">
        <asp:TreeView ID="tvMenu" runat="server">
            </asp:TreeView>
        </div>
        <div id="btn">
            <a id="arrow" onclick="changeLayout()">&lt;&lt;</a>
        </div>
        <iframe id="data" name="data" frameborder="0"></iframe>
    </form>
    <script type="text/javascript">
    function relogin()
    {
        location = "Default.aspx";
    }
    function exit()
    {
        if(confirm("确定要退出系统吗?"))
        {
            window.close();
        }
    }
    function initFrame()
    {
        var h1 = window.top.document.getElementById("head").offsetHeight;
        var h2 = window.top.document.getElementById("baseinfo").offsetHeight;
        var total = document.documentElement.clientHeight - h1 - h2 - 8;
    
        document.getElementById("data").style.height = total + "px";
        document.getElementById('menu').style.height = (total + 2) + "px";
        document.getElementById("btn").style.height = (total + 2) + "px";
    }
    function changeLayout()
    {
        if(document.getElementById("menu").style.display == "none")
        {
            document.getElementById("menu").style.display = "block";
            document.getElementById("data").style.width = "79%";
            document.getElementById("arrow").innerHTML = "&lt;&lt;";
        }
        else
        {
            document.getElementById("menu").style.display = "none";
            document.getElementById("data").style.width = "98%";
            document.getElementById("arrow").innerHTML = "&gt;&gt;";   
        }
    }
    function toEditPwd()
    {
        openwin("System/EditPwd.aspx",400,200,300);
    }
    window.onload = initFrame;
    window.onresize = initFrame;
    </script>
</body>
</html>
